﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Data;
using NHAHANGLIENHOACHAY_WS_BUS.SR_NHAHANG_DAO_DTO;
namespace NHAHANGLIENHOACHAY_WS_BUS
{
    /// <summary>
    /// Summary description for Service1
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class Service1 : System.Web.Services.WebService
    {
        Service1SoapClient dao = new Service1SoapClient();

        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }
        //-----Ban--------------------
        [WebMethod]
        public BAN[] LayDSBan()
        {
            BAN[] result;
            result = dao.LayDSBan();
            return result;
        }
        //Thêm bàn
        [WebMethod]
        public bool ThemBan(BAN dto, int makhuvuc)
        {
            return dao.ThemBan(dto, makhuvuc);
        }
        //Cập nhật bàn
        [WebMethod]
        public bool CapNhatBan(BAN dto,int makhuvuc)
        {
            return dao.CapNhatBan(dto,makhuvuc);
 
        }
        [WebMethod]
        public bool XoaBan(int maban)
        {
            return dao.XoaBan(maban);
        }
       //---KhuVuc------------------------
        [WebMethod]
        public KHUVUC LayKhuVucTheoMaBan(int maban)
        {
            return dao.LayKhuVucTheoMaBan(maban);
 
        }
        [WebMethod]
        public bool ThemKhuVuc(KHUVUC dto, int maht)
        {
            return dao.ThemKhuVuc(dto, maht);
        }
        [WebMethod]
        public bool CapNhatKhuVuc(KHUVUC dto,int mahinhthuckd)
        {
            return dao.CapNhatKhuVuc(dto,mahinhthuckd);
        }
        [WebMethod]
        public bool XoaKhuVuc(int makv)
        {
            return dao.XoaKhuVuc(makv);
        }
        [WebMethod]
        public KHUVUC[] LayDSKhuVuc()
        {
            KHUVUC[] result;
            result = dao.LayDSKhuVuc();                  
            return result;

        }
        [WebMethod]
        public BAN[] LayDSBanTheoKhuVuc(int makv)
        {
            BAN[] result;
            result = dao.LayDSBanTheoMaKhuVuc(makv);
            return result;
        }
        //---Hình Thức Kinh Doanh------------------
        [WebMethod]
        public HINHTHUCKD LayHinhThucKinhDanhTheoKV(int makv)
        {
            return dao.LayHinhThucKinhDanhTheoKV(makv);
        
        }
        [WebMethod]
        public HINHTHUCKD[] LayDSHinhThucKinhDanh()
        {
            return dao.LayDSHinhThucKinhDanh();
        }

        //---MonAn---------__________________
        [WebMethod]
        public bool ThemMonAn(MONAN dto, int maloaima)
        {
            return dao.ThemMonAn(dto, maloaima);
        }
        [WebMethod]
        public bool XoaMonAn(int mama)
        {
            return dao.XoaMonAn(mama);
        }
        [WebMethod]
        public MONAN LayDSMonAnTheoMa(int mama)
        {
            MONAN result;
            result = dao.LayMonAnTheoMa(mama);
            return result;

        }
        [WebMethod]
        public DataTable LayDSMonAnCoLoaiMonAn()
        {
            DataTable result;            
            result= dao.LayDSMonAnCoLoaiMonAn();
            return result;
        }
        [WebMethod]
        public LOAIMONAN LayLoaiMonAnTheoMaMonAn(int mama)
        {
            return dao.LayLoaiMonAnTheoMaMonAn(mama);
        }
        [WebMethod]
        public MONAN[] LayDSMonAn()
        {
            MONAN[] result;
            result = dao.LayDSMonAn();
            return result;
        }
        //Quản lý loại món ăn
        //Lấy danh sách loại món ăn

        [WebMethod]
        public LOAIMONAN[] LayDSLoaiMonAn()
        {
            LOAIMONAN[] result;
            result = dao.LayDSLoaiMonAn();
            return result;
        }
        //Thêm loại món ăn
        [WebMethod]
        public bool ThemLoaiMonan(LOAIMONAN dto)
        {
            return dao.ThemLoaiMonAn(dto);
        }
        //Xóa loại món ăn
        [WebMethod]
        public bool XoaLoaiMonAn(LOAIMONAN dto)
        {
            return dao.XoaLoaiMonAn(dto);
 
        }
        [WebMethod]
        public MONAN[] LayDSMonAnTheoMaLoai(int maloai)
        {
            MONAN[] result;
            result = dao.LayDSMonAnTheoMaLoai(maloai);
            return result;
        }
       //---LoaiPhieuDat
        [WebMethod]
        public LOAIPHIEUDAT[] LayDSLoaiPhieu()
        {
            LOAIPHIEUDAT[] result;
            result = dao.LayDSLoaiPhieu();
            return result;
        }
        //-----Hoa don
        [WebMethod]
        public HOADON LayMaHoaDon()
        {
            return dao.LayMaHoaDon();
        }
        [WebMethod]
        public HOADON[] LayDSHoaDon()
        {
            HOADON[] result;
            result = dao.LayDSHoaDon();
            return result;
        }
        [WebMethod]
        public bool ThemHoaDon(HOADON dto)
        {
            //dto = new HOADON();
            return dao.ThemHoaDon(dto);
           
        }      
        //--Quản lý chi tiết hóa đơn
        [WebMethod]
        public CTHOADON[] LayDSChiTietHoDonTheoMaBan(int maban)
        {
            CTHOADON[] result;
            result = dao.LayDSChiTietHoaDonTheoMaBan(maban);
            return result;
        }
        [WebMethod]
        public CTHOADON[] LayDSChiTietHoaDon()
        {
            CTHOADON[] result;
            result = dao.LayDSChiTietHoaDon();
            return result;
        }
        [WebMethod]
        public bool ThemChiTietHoaDon(CTHOADON dto)
        {
            return dao.ThemChiTietHoaDon(dto);
        }
        [WebMethod]
        public NGUOIDUNG[] LayDSNguoiDung()
        {
            NGUOIDUNG[] result;
            result = dao.LayDSNguoiDung();
            return result;
        }
       
    }
}